/*
 *  Copyright (C) 2010 Interactive Media Management
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package dk.i2m.converge.core.plugin;

import dk.i2m.converge.core.workflow.Edition;
import dk.i2m.converge.core.workflow.OutletEditionAction;
import dk.i2m.converge.core.security.UserAccount;
import dk.i2m.converge.core.plugin.Plugin;
import dk.i2m.converge.core.plugin.PluginContext;
import java.util.Map;
import java.util.ResourceBundle;

/**
 * Interface for implementing a {@link EditionAction}.
 *
 * @author Allan Lykke Christensen
 */
public abstract class EditionAction implements Plugin {

    private ResourceBundle msgs = ResourceBundle.getBundle("dk.i2m.converge.i18n.Messages");

    /**
     * Executes the {@link EditionAction}.
     *
     * @param ctx
     *           Context for which the plug-in is being executed
     * @param edition
     *          {@link Edition} being processed
     * @param action
     *          {@link OutletEditionAction} to be executed
     * @param user
     *          User that selected the step
     */
    public abstract void execute(PluginContext ctx, Edition edition, OutletEditionAction action, UserAccount user);

    /**
     * Provides a map of possible properties for the action.
     *
     * @return Map of possible action properties
     */
    public abstract Map<String, String> getAvailableProperties();

    /** #{@inheritDoc} */
    @Override
    public String getType() {
        return msgs.getString("plugin_TYPE_EDITION_ACTION");
    }
}
